home *** CD-ROM | disk | FTP | other *** search
- /* abs.c function, from page 195 of turbo C bible */
- #include <stdio.h>
- #include <stdlib.h>
- main(int argc, char **argv)
- {
- int value, result;
- if (argc < 2)
- {
- printf("Usage: %s <integer_value>\n", argv[0]);
- }
- else
- {
- value = atoi(argv[1]);
- result = abs(value);
- printf("abslute value of %d = %d\n", value, result);
- }
- }